/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package persistencia;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author hellen
 */
@Entity
@Table(name = "ENTREGA_PROD")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "EntregaProd.findAll", query = "SELECT e FROM EntregaProd e"),
    @NamedQuery(name = "EntregaProd.findByEntregaProdID", query = "SELECT e FROM EntregaProd e WHERE e.entregaProdID = :entregaProdID"),
    @NamedQuery(name = "EntregaProd.findByEntFechaActual", query = "SELECT e FROM EntregaProd e WHERE e.entFechaActual = :entFechaActual")})
public class EntregaProd implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "EntregaProdID")
    private Integer entregaProdID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "Ent_FechaActual")
    @Temporal(TemporalType.TIMESTAMP)
    private Date entFechaActual;
    @JoinColumn(name = "Ent_EmpleadoID", referencedColumnName = "EmpleadoID")
    @ManyToOne(optional = false)
    private Empleado entEmpleadoID;
    @JoinColumn(name = "Ent_CategoriaProdID", referencedColumnName = "CategoriaProdID")
    @ManyToOne(optional = false)
    private CategoriaProd entCategoriaProdID;

    public EntregaProd() {
    }

    public EntregaProd(Integer entregaProdID) {
        this.entregaProdID = entregaProdID;
    }

    public EntregaProd(Integer entregaProdID, Date entFechaActual) {
        this.entregaProdID = entregaProdID;
        this.entFechaActual = entFechaActual;
    }

    public Integer getEntregaProdID() {
        return entregaProdID;
    }

    public void setEntregaProdID(Integer entregaProdID) {
        this.entregaProdID = entregaProdID;
    }

    public Date getEntFechaActual() {
        return entFechaActual;
    }

    public void setEntFechaActual(Date entFechaActual) {
        this.entFechaActual = entFechaActual;
    }

    public Empleado getEntEmpleadoID() {
        return entEmpleadoID;
    }

    public void setEntEmpleadoID(Empleado entEmpleadoID) {
        this.entEmpleadoID = entEmpleadoID;
    }

    public CategoriaProd getEntCategoriaProdID() {
        return entCategoriaProdID;
    }

    public void setEntCategoriaProdID(CategoriaProd entCategoriaProdID) {
        this.entCategoriaProdID = entCategoriaProdID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (entregaProdID != null ? entregaProdID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EntregaProd)) {
            return false;
        }
        EntregaProd other = (EntregaProd) object;
        if ((this.entregaProdID == null && other.entregaProdID != null) || (this.entregaProdID != null && !this.entregaProdID.equals(other.entregaProdID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "persistencia.EntregaProd[ entregaProdID=" + entregaProdID + " ]";
    }
    
}
